<template>
  <div class="rightbox" v-cloak>
    <h1>公司中心 > 订单列表</h1>
    <el-table
    :data="contentList"
    border
    style="width: 96%;margin:2%">
      <el-table-column
        prop="personalUserName"
        label="姓名">
      </el-table-column>
      <el-table-column
        prop="personalUserPhone"
        label="手机号码">
      </el-table-column>
      <el-table-column
        prop="fixArea"
        label="房屋面积(平米)">
      </el-table-column>
      <el-table-column
        prop="fixMoney"
        label="预算">
      </el-table-column>
      <el-table-column
        prop="fixTime"
        label="装修时间">
      </el-table-column>
      <el-table-column
        prop="talkinfo"
        label="地区">
        <template slot-scope="scope">
          <span>{{scope.row.province}}</span>
          <span>{{scope.row.city}}</span>
          <span>{{scope.row.area}}</span>
        </template>
      </el-table-column>
    </el-table>
    <div class="page" v-if="total >= pagelimit">
      <el-pagination
        background
        layout="prev, pager, next"
        @current-change="handleCurrentChange"
        :page-size="pagelimit"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      contentList: [],
      contype: [],
      pagelimit: 5,
      designindex: '',
      pageindex: 0,
      total: '',
      casename: ''
    }
  },
  methods: {
    Search: function () {
      var that = this
      that.getList()
    },
    getList: function () {
      var that = this
      that.$axios.request('post', '/CompanyOrder/Index', {
        Pagelimit: that.pagelimit,
        Pageindex: that.pageindex
      })
        .then((res) => {
          if (res.code === 0) {
            that.contentList = res.data.datalist
            that.total = res.data.total
          }
        })
    },
    handleCurrentChange (val) {
      var that = this
      that.pageindex = val
      that.getList()
    }
  },
  mounted () {
    this.getList()
  }
}
</script>
